package org.zcl.java8;

import java.util.Optional;

/**
 * @PROJECT_NAME:
 * @DESCRIPTION:
 * @USER: ZhuChengLin
 * @DATE: 2021/11/23 18:14
 */
public class Demo {
    public static void main(String[] args) {
        System.out.println(Optional.ofNullable("正品").orElse("替代品"));  // orElse
        System.out.println(Optional.ofNullable(null).orElse("替代品"));
    }
}
